home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 34
/
Amiga Format CD34 (1998-11-20)(Future Publishing)(GB)[!][Christmas issue].iso
/
-seriously_amiga-
/
programming
/
basic
/
blitzc2p
/
game
/
rupture
/
rupture.ascii
< prev
next >
Wrap
Text File
|
1998-10-01
|
3KB
|
77 lines
WBStartup
;Main
DEFTYPE.w
INCLUDE "Prefs.bb2"
INCLUDE "Variables.bb2"
INCLUDE "Display.bb2"
InitPalette 0,256
For c=1 To 255: AGAPalRGB 0,c,Rnd(255),Rnd(255),Rnd(255) : Next c
If InitDisplay{"Rupture"}=False Then Goto Finish
If InitBackground{"Default"}=False Then Goto Finish
If InitLand{"Default"}=False Then Goto Finish
Multitasking{Off}
buf=0
YAdder=-1
XAdder=60
While Joyb(0)=0 AND Joyb(1)=0
If PrefDisplayBuffering=2 Then buf=1-buf ; Only works for doublebuffered display
If NumberOfPlayers=1
If PrefBackdrop
ChunkyCopy16{BackgroundBase+(PrefDisplayWidth*BGPos(1)),ChunkyBuffer,GameHeight,CPUminimum,PrefDisplayWidth,PrefDisplayWidth}
Else
ChunkyClearscreen32{ChunkyBuffer,GameHeight,ClearScreenTo,PrefDisplayWidth}
EndIf
LandCopy16{LandBase,LandBuffer,LandPos(1),PrefDisplayWidth,PrefDisplayWidth}
ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,PrefDisplayWidth,PrefDisplayWidth,0}
EndIf
If NumberOfPlayers=2
If PrefBackdrop
ChunkyCopy16{BackgroundBase+(PrefDisplayWidth*BGPos(1)),ChunkyBuffer,GameHeight,CPUminimum,DisplaySplit,PrefDisplayWidth}
a.l=BackgroundBase+(PrefDisplayWidth*BGPos(2))+DisplaySplit
b.l=ChunkyBuffer+DisplaySplit
ChunkyCopy16{a,b,GameHeight,CPUminimum,PrefDisplayWidth-DisplaySplit,PrefDisplayWidth}
Else
ChunkyClearscreen32{ChunkyBuffer,GameHeight,ClearScreenTo,PrefDisplayWidth}
EndIf
LandCopy16{LandBase,LandBuffer,LandPos(1),DisplaySplit,PrefDisplayWidth}
LandCopy16{LandBase,LandBuffer+DisplaySplit,LandPos(2),PrefDisplayWidth-DisplaySplit,PrefDisplayWidth}
ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,DisplaySplit,PrefDisplayWidth,Clear4}
ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,PrefDisplayWidth,PrefDisplayWidth,0}
EndIf
;Player 1 control
LandPos(1)-1
XAdder+Joyx(1)*2
LandPos(1)+XAdder
YAdder+Joyy(1)*2
If XAdder<0 AND buf=0 Then XAdder+1
If XAdder>0 AND buf=0Then XAdder-1
If YAdder<-1 AND buf=0Then YAdder+1
If YAdder>1 AND buf=0Then YAdder-1
If LandPos(1)>=#LandWidth Then LandPos(1)-#LandWidth
If LandPos(1)<0 Then LandPos(1)+#LandWidth
If BGPos(1)>=BGHeight Then BGPos(1)-BGHeight
If BGPos(1)<0 Then BGPos(1)+BGHeight
;Player 2 control
LandPos(2)+4
If LandPos(2)>=#LandWidth Then LandPos(2)-#LandWidth
If LandPos(2)<0 Then LandPos(2)+#LandWidth
BGPos(1)+YAdder
BGPos(2)-1
If BGPos(2)>BGHeight Then BGPos(2)-BGHeight
If BGPos(2)<0 Then BGPos(2)+BGHeight
VWait
Display{buf}
Wend
Finish:
Multitasking{On}
If IsAGA Then FreeAGA{} ; Restore hacked AGA bitmaps for safe freeing
End